#include <math.h>
#include <stdio.h>
#include "snipmath.h"

double d_mul(double a, double b) {
  
  *(double *)ADDR_MUL1 = a;
  *(double *)ADDR_MUL2 = b;

  return *(double *)ADDR_MULR;
}

double d_add(double a, double b) {

  *(double *)ADDR_ADD1 = a;
  *(double *)ADDR_ADD2 = b;

  return *(double *)ADDR_ADDR;
}

double d_div(double a, double b) {

  *(double *)ADDR_DIV1 = a;
  *(double *)ADDR_DIV2 = b;

  return *(double *)ADDR_DIVR;
}

double d_sqrt(double a) {

  *(double *)ADDR_SQRT1 = a;

  return *(double *)ADDR_SQRTR;
}

double d_pow(double a, double b) {

  *(double *)ADDR_POW1 = a;
  *(double *)ADDR_POW2 = b;

  return *(double *)ADDR_POWR;
}
